layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'address'], function () {
    var $ = layui.jquery;
    var HttpRequest = layui.HttpRequest;
    var form = layui.form;
    var admin = layui.admin;
    var studentId = Feng.getUrlParam("studentId");
    if (studentId === null){
        admin.closeThisDialog();
    }
    var httprequest = new HttpRequest(Feng.ctxPath + '/student/printdetail?id=' + studentId, 'get');
    var result = httprequest.start();
    var mainData = result.data;
    if (mainData === null){
        Feng.error("数据获取失败。 reason: " + result.message);
    }
    var studentObj = mainData.student;
    var sex = studentObj.sex;
    if (sex ==='M'){
        studentObj.sex = '男'
    }else{
        studentObj.sex = '女'
    }
    studentObj.birthday = studentObj.birthday.replace('00:00:00','').trim();
    studentObj.address = mainData.addressArea+studentObj.address;
    mainData.accordRegistered === false? mainData.accordRegistered = '否':mainData.accordRegistered = '是';
    mainData.accordHouse === false? mainData.accordHouse = '否':mainData.accordHouse = '是';
    form.val('studentPrintForm', studentObj);
    form.val('studentPrintForm', mainData);
    window.sessionStorage.setItem("printInfo",JSON.stringify(result.data));
});
